import unit
import item

class dungeon:
    '''dungeon map generator'''
    def __init__(self,dsize,dtype,dlevel):
        self.dsize = dsize
        self.dtype = dtype
        self.dlevel = dlevel
        self.dunits = []
        self.generate_map()

    def generate_map(self):
        self.blank = []
        for i in range(self.dsize[0]):
            for j in range(self.dsize[1]):
                self.blank += [[i+1,j+1]]
        self.wall = []
        for i in range(self.dsize[0]+2):
            self.wall += [[0,i]]
            self.wall += [[self.dsize[1]+1,i]]
        for i in range(self.dsize[1]+2):
            self.wall += [[i,0]]
            self.wall += [[i,self.dsize[0]+1]]

    def add(self,u):
        self.dunits += [u]
        self.update()
